/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author julio
 */
@Entity
@Table(name = "agency", catalog = "transit", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Agency.findAll", query = "SELECT a FROM Agency a"),
    @NamedQuery(name = "Agency.findByAgencyId", query = "SELECT a FROM Agency a WHERE a.agencyId = :agencyId"),
    @NamedQuery(name = "Agency.findByAgencyName", query = "SELECT a FROM Agency a WHERE a.agencyName = :agencyName"),
    @NamedQuery(name = "Agency.findByAgencyUrl", query = "SELECT a FROM Agency a WHERE a.agencyUrl = :agencyUrl"),
    @NamedQuery(name = "Agency.findByAgencyTimezone", query = "SELECT a FROM Agency a WHERE a.agencyTimezone = :agencyTimezone"),
    @NamedQuery(name = "Agency.findByAgencyLang", query = "SELECT a FROM Agency a WHERE a.agencyLang = :agencyLang"),
    @NamedQuery(name = "Agency.findByAgencyPhone", query = "SELECT a FROM Agency a WHERE a.agencyPhone = :agencyPhone")})
public class Agency implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "agency_id", nullable = false, length = 45)
    private String agencyId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "agency_name", nullable = false, length = 255)
    private String agencyName;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "agency_url", nullable = false, length = 45)
    private String agencyUrl;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "agency_timezone", nullable = false, length = 45)
    private String agencyTimezone;
    @Size(max = 2)
    @Column(name = "agency_lang", length = 2)
    private String agencyLang;
    @Size(max = 45)
    @Column(name = "agency_phone", length = 45)
    private String agencyPhone;

    public Agency() {
    }

    public Agency(String agencyId) {
        this.agencyId = agencyId;
    }

    public Agency(String agencyId, String agencyName, String agencyUrl, String agencyTimezone) {
        this.agencyId = agencyId;
        this.agencyName = agencyName;
        this.agencyUrl = agencyUrl;
        this.agencyTimezone = agencyTimezone;
    }

    public String getAgencyId() {
        return agencyId;
    }

    public void setAgencyId(String agencyId) {
        this.agencyId = agencyId;
    }

    public String getAgencyName() {
        return agencyName;
    }

    public void setAgencyName(String agencyName) {
        this.agencyName = agencyName;
    }

    public String getAgencyUrl() {
        return agencyUrl;
    }

    public void setAgencyUrl(String agencyUrl) {
        this.agencyUrl = agencyUrl;
    }

    public String getAgencyTimezone() {
        return agencyTimezone;
    }

    public void setAgencyTimezone(String agencyTimezone) {
        this.agencyTimezone = agencyTimezone;
    }

    public String getAgencyLang() {
        return agencyLang;
    }

    public void setAgencyLang(String agencyLang) {
        this.agencyLang = agencyLang;
    }

    public String getAgencyPhone() {
        return agencyPhone;
    }

    public void setAgencyPhone(String agencyPhone) {
        this.agencyPhone = agencyPhone;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (agencyId != null ? agencyId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Agency)) {
            return false;
        }
        Agency other = (Agency) object;
        if ((this.agencyId == null && other.agencyId != null) || (this.agencyId != null && !this.agencyId.equals(other.agencyId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jpa.entities.Agency[ agencyId=" + agencyId + " ]";
    }
    
}
